import time


def metric(fn):
    def wrapper(*args, **kwargs):
        print('='*100)
        start_time = time.time()
        fn(*args, **kwargs)
        end_time = time.time()
        print('='*100)
        print('耗时：{:.4f}s'.format(end_time - start_time))

    return wrapper

# test
@metric
def run():
    time.sleep(1)
    y = [x ** x for x in range(100)]
    print(y)


run()
